package com.bupt.ilink.mapper.innovationPlaza;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bupt.ilink.entity.innovationPlaza.DTO.ProjectdetailsMembersResponse;
import com.bupt.ilink.entity.innovationPlaza.ProjectUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigInteger;
import java.util.List;

@Mapper
public interface ProjectUserMapper extends BaseMapper<ProjectUser> {

   /* @Select("SELECT pu.user_type, pu.user_identity, um.user_image, um.user_name, um.user_Introduction AS userIntroduction, um.user_college " +
            "FROM project_user pu " +
            "JOIN user_metadata um ON pu.user_id = um.user_id " +
            "WHERE pu.project_id = #{projectId}")
    List<ProjectdetailsMembersResponse> getProjectMembersByProjectId(BigInteger projectId);*/
   @Select("SELECT pu.user_type, pu.user_name, pu.user_college, pu.user_introduction, pu.user_grade, pu.user_major, pu.user_image " +
           "FROM project_user pu " +
           "WHERE pu.project_id = #{projectId}")
   List<ProjectUser> getProjectMembersByProjectId(@Param("projectId") Long projectId);
}
